package com.dmz.auth.service.impl;

import java.util.Collection;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import com.dmz.auth.entity.UserInfo;
import com.dmz.auth.mapper.UserInfoMapper;
import com.dmz.auth.model.AuthUserDetails;
import com.dmz.auth.service.UserInfoService;
import com.github.yulichang.base.MPJBaseServiceImpl;

@Service("userDetailsService")
public class UserInfoServiceImpl extends MPJBaseServiceImpl<UserInfoMapper, UserInfo> implements UserInfoService,UserDetailsService{

	@Override
	public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
		/**
		UserInfo userInfo=this.lambdaQuery().eq(UserInfo::getLoginName, username).last("limit 1 ").one();
		if(userInfo==null) {
			throw new UsernameNotFoundException(username+":不存在！");
		}
		**/
		return  new AuthUserDetails();
	}
	
}
